import request from '@/utils/request'
import { run } from 'runjs'

/**新增部门
 * @param {code,introduce,manager,name,pid} data
 */
export function addDepartments(data){
 return request({
  url:'/company/department',
  method:'post',
  data
 } )
}
/** 查询企业的部门列表
 * @param
 */
export function getDepartments(){
  return request({
    url:'/company/department'
  })
}

/**修改部门列表
 * @param {id} data
 * 
 */
export function updeteDepartments(data){
  return request({
    url:`/company/department/${data.id}`,
    method:'put',
    data
  })
}

/**删除部门
 *  @param {id}
 */
export function delDepartments(id){
  return request({
    url:`/company/department/${id}`,
    method:'delete'
  })
}

/**查询部门详情
 *  @param {id}
 */
export function chaDepartments(id){
  return request({
    url:`/company/department/${id}`
  })
}